package org.beiji.userservice.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.beiji.userservice.dto.req.UserLoginReqDTO;
import org.beiji.userservice.dto.resp.UserLoginRespDTO;
import org.beiji.userservice.service.UserLoginService;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class UserLoginServiceImpl implements UserLoginService {


    @Override
    public UserLoginRespDTO login(UserLoginReqDTO userLoginReqDTO) {

        // 取出登录的账号
        String usernameOrMailOrPhone = userLoginReqDTO.getUsernameOrMailOrPhone();

        //判断是邮箱登录或手机
        boolean mailFlag = false;

        for (char c : usernameOrMailOrPhone.toCharArray()) {
            if (c == '@') {
                mailFlag = true;
                break;
            }
        }

        String username;

        if (mailFlag) {


        }

        return null;
    }
}
